import java.util.Comparator;


public class QValuesComparator implements Comparator<StateAction>{

	@Override
	public int compare(StateAction o1, StateAction o2) {
		if (o1.state.numberOfTransmittedChannels != o2.state.numberOfTransmittedChannels) {
			return o1.state.numberOfTransmittedChannels - o2.state.numberOfTransmittedChannels;
		} else {
			if (o1.state.numberOfInterferences != o2.state.numberOfInterferences) {
				return o1.state.numberOfInterferences - o2.state.numberOfInterferences;
			} else {
				return o1.action.ordinal() - o2.action.ordinal();
			}
		}
	}

}
